package com.example.crossborderecommerce.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 用户评价
 */
@Data
@Accessors(chain = true)
@TableName("review")
public class Review implements Serializable{

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("order_id")
    private Integer orderId;

    @TableField(exist = false)
    private Product product;

    @TableField(exist = false)
    private String shopName;

    @TableField(exist = false)
    private String customerName;

    @TableField("like_count")
    private Integer likeCount;

    @TableField("grade")
    private Integer grade;

    @TableField("content")
    private String content;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //指定格式
    private LocalDateTime createTime;
}
